<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>06事件修饰符</title>
		<script src="js/vue.js" type="text/javascript" charset="utf-8"></script>
		<style type="text/css">
			.demo1{
				width: 200px;
				height: 300px;
				background-color: #55aa00;
			}
		</style>
	</head>
	<body>
		<div id="root">
			<h2>欢迎来到{{name}}</h2>
			<a href="https://live.bilibili.com/7170396" @click.prevent="yu">鱼清一的直播间</a>
			<!-- .prevent阻止默认行为 -->
			<!-- 阻止事件冒泡 -->
			<div class="demo1" @click="xianshi">
				<button type="button" @click.stop="xianshi">点击提示</button>
			</div>
			<!-- 事件只触发一次 -->
			<button type="button" @click.once="xianshi">点击提示</button>
		</div>
		<script type="text/javascript">
			let root = new Vue({
				el:"#root",
				data:{
					name:'重庆',
				},
				methods:{
					yu:function(){
						alert("跳转到鱼清一的直播间");
					},
					xianshi:function(){
						alert('哈喽');
					}
				}
			})
		</script>
	</body>
</html>
